/*
 * @Author: humengchuan 531537052@qq.com
 * @Date: 2024-12-04 11:49:16
 * @LastEditors: humengchuan 531537052@qq.com
 * @LastEditTime: 2025-08-25 16:27:08
 * @FilePath: \project-my\learn-nest\src\main.ts
 * @Description: s
 */
import { NestFactory } from '@nestjs/core'
import { AppModule } from './app.module'
import { Logger } from '@nestjs/common'

async function bootstrap() {
  const app = await NestFactory.create(AppModule)
  const logger = new Logger()
  // app.setGlobalPrefix('api/v1') // 全局前缀
  const port = process.env.PORT ?? 3006

  // console.log(`NEST服务端已启动: \x1b[32m http://localhost:${port} \x1b[0m  \n`)
  await app.listen(port)
  logger.log(`NEST服务端已启动: ${'http://localhost:' + port}`)
}
bootstrap()
